<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        var r1 = 10+10;
        var r2 = "10"+10; //"1010"
        var r3 = 5+10+"10"; //15+"10"
        var r4 = "10"+5+10; //"105"+10
        var r5 = "10"+true; //"10true"
        console.log(r5);
        var r6 = 10+ true +"10"; //"1110"
        var r7 = "10" + undefined; //"10undefinded"
        console.log(r7,r6);
        var r8 = "10" + null; "10null"
        console.log(r8)

        var s1 = 10 + true; //11
         //undefinded 首先转换number 返回NaN(not a number,转换失败)
         // 10+NaN = NaN
        var s2 = 10 + undefined; // NaN
        console.log(s2)
        var s3 = 10+null; // 10
        console.log(s3);
        var s4 = true + true; //2
        console.log(s4);
        
        var a =100;
        var a1=a.toString();
        console.log(a,typeof a)
        console.log(a1,typeof a1)
        var s1 = Number("35.5");
        var s2 = Number(true);
        var s3 = Number("18a");
        console.log(s1,s2,s3)
        var s1 = parseInt(35.5); // 35
        var s2 = parseInt("18.5a"); // 18
        var s3 = parseInt("a18"); //NaN
        console.log(s1,s2,s3)
        var s1 = parseFloat("35.5");
        var s2 = parseFloat("18.5a");
        var s3 = parseFloat("9.3.5a");
        console.log(s1,s2,s3)
        var s6 = parseFloat("1.5e3");
        var s7 = Number("1.5e3");
        console.log(s6,s7);
                        
                        
                        
    </script>
</head>
<body>
    
</body>
</html>